//
//  MainPageView.m
//  UcarTest
//
//  Created by 陈曦 on 16/1/13.
//  Copyright © 2016年 chenxi. All rights reserved.
//

#import "MainPageView.h"
#import "Define.h"

@implementation MainPageView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //背景色
        self.backgroundColor = [UIColor whiteColor];
        
        //伪造一个导航条
        [self forgeAnNavigationController];
        
    }
    return self;
}




#pragma mark 伪造一个导航条
- (void) forgeAnNavigationController {
    
    UIView *navigationView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 64)];
    navigationView.backgroundColor = mainColor;
    [self addSubview:navigationView];
    
    //菜单栏跳转按钮
    self.menuBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.menuBtn.frame = CGRectMake(10, 24, 30, 30);
    [self.menuBtn setImage:[UIImage imageNamed:@"mian-head-Img"] forState:UIControlStateNormal];
    [navigationView addSubview:self.menuBtn];
    
    UILabel * nameCenterLabel = [[UILabel alloc] initWithFrame:CGRectMake( (kScreenWidth - kScreenWidthEight * 2) / 2, 24, kScreenWidthEight * 2, 30)];
    nameCenterLabel.text = @"联合出行";
    nameCenterLabel.textColor = [UIColor whiteColor];
    nameCenterLabel.textAlignment = NSTextAlignmentCenter;
    nameCenterLabel.font = [UIFont boldSystemFontOfSize:18];
    [navigationView addSubview:nameCenterLabel];
    
}


@end
